<template>
	<view class="person_bank_revise">
		<view class="main">
			
			
			<view class="input">
				<view class="left">代理姓名</view>
				<view class="right">
					<u-input v-model="user_info.nickname" type="text" :clearable='false' placeholder='请输入姓名或昵称' />
				</view>
			</view>
			<view class="input">
				<view class="left">联系电话</view>
				<view class="right">
					<u-input v-model="user_info.mobile" type="text" :clearable='false' placeholder='请输入联系电话' />
				</view>
			</view>
			<view class="input">
				<view class="left">真实姓名</view>
				<view class="right">
					<u-input v-model="user_info.truthname" type="text" :clearable='false' placeholder='请输入真实姓名' />
				</view>
			</view>
			<view class="input">
				<view class="left">支付宝</view>
				<view class="right">
					<u-input v-model="user_info.zfb_account" type="text" :clearable='false' placeholder='请输入支付宝账号' />
				</view>
			</view>
			<view class="input">
				<view class="left">微信号</view>
				<view class="right">
					<u-input v-model="user_info.wx" type="text" :clearable='false' placeholder='请输入微信号' />
				</view>
			</view>
		</view>
		<!-- 底部 -->
		<BottomBtn title='保存' @submit='submitBtn'></BottomBtn>
	</view>
</template>

<script>
	import { mapState } from 'vuex';
	import BottomBtn from '@/components/bottom_btn/bottom_btn.vue';
	export default {
		components:{
			BottomBtn
		},
		data() {
			return {
				show:false,
				list:[],
				bankId:'',
				bank:'',
				card:'',
				// 
				code:'',
				disabled:false,
				sendTime:60,
				time:null,
				user_info:[]
			};
		},
		onLoad() {
			this.bankList()
		},
		methods:{
			bankList(){
				var that = this
				that.$tips.showLoading('加载中')
				that.$httpApi.userShop().then((res)=>{
					that.$tips.hideLoading()
					if(res.code==1){
						that.user_info = res.data.userinfo;
					}
				})
			},
			
			// 底部按钮
			submitBtn(){
				var that = this
					that.$tips.showLoading('保存中')
					var params = {
						nickname:that.user_info.nickname,
						mobile:that.user_info.mobile,
						truthname:that.user_info.truthname,
						zfb_account:that.user_info.zfb_account,
						wx  :that.user_info.wx
					}
					that.$httpApi.bankcard(params).then((res)=>{
						that.$tips.hideLoading()
						if(res.code==1){
							that.$tips.showToast('保存成功')
							that.$store.dispatch('GetUserInfo')
							setTimeout(function(){
								uni.navigateBack()
							},2000)
						}
					})
			},
		}
	}
</script>

<style lang="less">
	.person_bank_revise{
		width: 100%;
		padding-top: 24rpx;
		.main{
			width: 100%;
			padding: 20rpx 32rpx;
			background: #fff;
			.input{
				width: 100%;
				height: 100rpx;
				display: flex;
				align-items: center;
				.left{
					width: 200rpx;
					font-size: 28rpx;
					font-family: PingFang SC-Medium, PingFang SC;
					font-weight: 500;
					color: #222222;
				}
				.right{
					width: calc(100% - 200rpx);
					display: flex;
					align-items: center;
					u-input{
						width: 100%;
						font-size: 28rpx;
						font-family: PingFang SC-Medium, PingFang SC;
						font-weight: 500;
						color: #222222;
					}
					.right_text{
						width: 100%;
						display: flex;
						align-items: center;
						justify-content: space-between;
						.r_txt{
							font-size: 28rpx;
							font-weight: 500;
							color: rgb(192, 196, 204);
						}
						.r_txt_color{
							color: #222222;
						}
					}
				}
				.right_code{
					width: calc(100% - 200rpx);
					display: flex;
					align-items: center;
					justify-content: space-between;
					u-input{
						width: calc(100% - 160rpx);
						font-size: 28rpx;
						font-family: PingFang SC-Medium, PingFang SC;
						font-weight: 500;
						color: #222222;
					}
					text{
						display: block;
						width: 160rpx;
						line-height: 70rpx;
						text-align: center;
						font-size: 28rpx;
						font-family: PingFang SC-Regular, PingFang SC;
						font-weight: 400;
						color: #26C281;
					}
				}
			}
		}
	}
</style>
